unit u_consultapadraoabasgestao;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, u_consultapadraoabas, AdvOfficePager, AdvOfficePagerStylers,
  Grids, DBGrids, JvExDBGrids, JvDBGrid, AdvGlowButton, StdCtrls, AdvEdit,
  DBAdvEd, ExtCtrls, Buttons, ToolWin, JvExForms, JvScrollPanel, ImgList,
  FMTBcd, DB, DBClient, Provider, SqlExpr, AdvDBLookupComboBox,
  frm_empresafilial;

type
  TFRM_ConsultaPadraoAbasGestao = class(TFRM_ConsultaPadraoAbas)
    AbaRegistro: TAdvOfficePage;
    pnlFormulario: TPanel;
    pnlTitulo: TPanel;
    Image2: TImage;
    pnlOperacao: TPanel;
    btnGravar: TAdvGlowButton;
    btnFechar: TAdvGlowButton;
    dsRegistro: TDataSource;
    dsConsulta: TDataSource;
    procedure FormShow(Sender: TObject);
    procedure btnFecharClick(Sender: TObject);
    procedure btnNovoClick(Sender: TObject);
    procedure btnAlterarClick(Sender: TObject);
    procedure AbaRegistroShow(Sender: TObject);

  private

  public
  
  end;

var
  FRM_ConsultaPadraoAbasGestao: TFRM_ConsultaPadraoAbasGestao;

implementation

uses u_dm_geral, lib_sistema;

{$R *.dfm}

procedure TFRM_ConsultaPadraoAbasGestao.FormShow(Sender: TObject);
begin
  inherited;
  AbaRegistro.TabVisible := false;
end;

procedure TFRM_ConsultaPadraoAbasGestao.btnFecharClick(Sender: TObject);
begin
  inherited;
  AbaRegistro.TabVisible    := false;
  AdvOfficePager.ActivePage := AbaConsulta;
end;

procedure TFRM_ConsultaPadraoAbasGestao.btnNovoClick(Sender: TObject);
begin
  inherited;
  AbaRegistro.TabVisible    := true;
  AbaRegistro.Caption       := 'Inserir Novo Registro';
  AbaRegistro.ImageIndex    := 1;
  AdvOfficePager.ActivePage := AbaRegistro;
end;

procedure TFRM_ConsultaPadraoAbasGestao.btnAlterarClick(Sender: TObject);
begin
  inherited;
  AbaRegistro.TabVisible    := true;
  AbaRegistro.Caption       := 'Alterar Registro';
  AbaRegistro.ImageIndex    := 2;
  AdvOfficePager.ActivePage := AbaRegistro;
end;

procedure TFRM_ConsultaPadraoAbasGestao.AbaRegistroShow(Sender: TObject);
begin
  inherited;
  pnlFormulario.Left := (Self.Width  - pnlFormulario.Width)  div 2;
  //pnlFormulario.Top  := (Self.Height - pnlFormulario.Height) div 2;
end;

end.
